/**
 * Jul 26, 2020  copy right
 */
package com.code260.ss.spring3mybatis.demo;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.core.annotation.AnnotationUtils;

/**
 * @author code260@qq.com
 *
 */
public class HelloServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 11646835395418059L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doService(resp);
	}

	private void doService(HttpServletResponse resp) throws IOException, UnsupportedEncodingException {
		AnnotationUtils.getDefaultValue(Resource.class);
		resp.getOutputStream().write("hello123".getBytes("UTF-8"));
		resp.getOutputStream().flush();
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doService(resp);
	}
	
	

}
